<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // apifox、REST Client
      // 调用后端接口（函数），需要考虑输入和输出
      const xhr = new XMLHttpRequest();
      xhr.open("GET", "http://127.0.0.1:3000/posts");
      xhr.onload = function () {
        console.log("onload");
      };
      xhr.onerror = function () {
        console.log("onerror");
      };
      xhr.onprogress = function () {
        console.log("onprogress");
      };
      xhr.send();
    </script>
  </body>
</html>
